package com.wty.design.creational.singleton;

/**
 * @Author wangtengyu
 * @Create 2018-09-18-15:33
 */
public class ThreadLocalSingleton {

    private static final ThreadLocal<ThreadLocalSingleton> threadLocal=new ThreadLocal<ThreadLocalSingleton>(){
        @Override
        protected ThreadLocalSingleton initialValue() {
            return new ThreadLocalSingleton();
        }
    };


    private ThreadLocalSingleton(){

    }

    public ThreadLocalSingleton getInstance(){
        return threadLocal.get();
    }




}
